package com.ccys.app.feignClient;

import com.ccys.common.vo.ResponseResult;
import feign.Request;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;


   /**
    *
    * 调用demo
    * @Resource
    *     private NettyFeignService nettyFeignService;
    *     ResponseResult responseResult = this.nettyFeignService.sendMessageWebSocket(new Request.Options(6000, 6000), "123456","测试推送消息啊", "ok");
    *
    * @description 通用websocket发送 消息
    * @date     2024/2/27
    * @author   cloud fly

    */
@FeignClient(value = "netty",contextId = "nettyPush")
public interface NettyFeignService {

       /**
        * @description 通用websocket给用户发送消息
        * @param objId  booking表的ID
        * @param msg  推送消息内容
        * @date     2024/2/27
        * @author   cloud fly
        */
    @PostMapping("/push/sendMessageWebSocket")
    public ResponseResult sendMessageWebSocket(Request.Options options, @RequestParam("objId") String objId,@RequestParam("msg") String msg, @RequestHeader("gatewayPass") String pass);

   /**
    * @description 通用websocket给 所有用户通道发送消息
    * @param msg  推送看消息内容
    * @date     2024/2/27
    * @author   cloud fly
    */
   @PostMapping("/push/sendMessageAllWebSocket")
   public ResponseResult sendMessageAllWebSocket(Request.Options options, @RequestParam("msg") String msg, @RequestHeader("gatewayPass") String pass);

       /**
        * @description 通用websocket给服务端发送消息
        * @param userId  用户ID
        * @param msg  推送看消息内容
        * @date     2024/2/27
        * @author   cloud fly
        */
       @PostMapping("/push/sendMessageWebSocketToServer")
       public ResponseResult sendMessageWebSocketToServer(Request.Options options, @RequestParam("userId") String userId,@RequestParam("msg") String msg, @RequestHeader("gatewayPass") String pass);



}
